package xyz.archknight.app.loginput.dictionary.gen.dao

import org.jetbrains.exposed.dao.IntEntity
import org.jetbrains.exposed.dao.IntEntityClass
import org.jetbrains.exposed.dao.id.EntityID
import org.jetbrains.exposed.dao.id.IntIdTable
import org.jetbrains.exposed.sql.Column

/**
 * 内存词库数据表定义
 *
 * @author midnite
 * create at 2020-06-18 6:06 上午
 */

object Words : IntIdTable() {
    val phase: Column<String> = varchar("word", 255).uniqueIndex()
    val pinyin: Column<String> = varchar("pinyin", 500)
}

class Word(id: EntityID<Int>) : IntEntity(id) {
    companion object : IntEntityClass<Word>(Words)

    var phase by Words.phase
    var pinyin by Words.pinyin
}

object Caches : IntIdTable() {
    val phase: Column<String> = varchar("word", 255).uniqueIndex()
    val pinyin: Column<String> = varchar("pinyin", 500)
}

class Cache(id: EntityID<Int>) : IntEntity(id) {
    companion object : IntEntityClass<Cache>(Caches)

    var phase by Caches.phase
    var pinyin by Caches.pinyin
}